<template>
	<div class="conbox">
		<div class="assset_top">
			<p>可用积分</p>
			<p>{{asset_count.pay_points}}</p>
			<!--<p>可用积分数：{{asset_count.pay_points}}</p>-->
		</div>
		<ul class="assset_money">
			<li @click="skippaymodule('InviteAward')">去赚钱</li>
			<li @click="skippaymodule('Payment',asset_count.pay_points)">去充值</li>
		</ul>
		<div class="list_content">
			<ul>
				<li @click="skipfrozen" v-if="false">
					<span>冻结资金账户</span>
					<span>￥{{asset_count.frozen_money}}</span>
				</li>
				<li @click="skiprecord" v-if="false">
					<span>申请记录</span>
				</li>
				<!--  <div class="lab_line"></div>-->
				<li @click="skippaymodule('IntegralDetail')">
					<span>积分明细</span>
				</li>
				<li  @click="skippaymodule('CashDetails')" v-if="false">
					<span>资金明细</span>
				</li>
				<li v-if="$util.shieldReview()" @click="skippaymodule('MyMission')">
					<span>积分任务</span>
				</li>
			</ul>
		</div>
		<uLiLoadMore  :loadingType="loadingType" :contentText="contentText" ></uLiLoadMore>
	</div>
</template>

<script>
import { mapGetters, mapState } from 'vuex'
import { getwallet } from '@/api/payment'
export default {
	name: 'intergralMain',
	data() {
		return {
			owner_user_id: '',
			asset_count: '',
			is_real: '',
			has_recharge: ''
		}
	},
	...mapGetters({ userInfo: 'getUser' }),
	onLoad(opcation) {
		this.owner_user_id = opcation.owner_user_id
		this.has_recharge = opcation.has_recharge
	},
	mounted() {
		this.getasset()
	},
	methods: {
		getasset() {
			let data = {
				ru_id: this.owner_user_id
			}
			getwallet(data).then(res => {
				if (res.status == 'success') {
					this.asset_count = res.data
					this.is_real = res.data.is_real
				} else {
					uni.showToast({
						title: res.message,
						icon: 'none'
					})
				}
			})
		},
		skippaymodule(typename, typemoney) {
			if (typename == 'IntegralDetail') {
				uni.navigateTo({ // 积分明细
					url: `/pages/integral/interalDetail?owner_user_id=${this.owner_user_id}`
				})
			} else if (typename == 'InviteAward') {
				uni.navigateTo({ // 去赚钱
					url: `/pages/getGuest/inviteShop?owner_user_id=${this.owner_user_id}`
				})
			} else if (typename == 'MyMission') {
				uni.navigateTo({ // 我的任务
					url: `/pages/integral/myMission?owner_user_id=${this.owner_user_id}`
				})
			} else if (typename == 'Payment') {
				let query = {
					owner_user_id: this.owner_user_id,
					sourceinintegral: typemoney,
					has_recharge: this.has_recharge
				}
				uni.navigateTo({ // 积分充值页面
					url: `/pages/integral/integralPay${this.commonJS.queryData(query)}`
				})
			}
		}
	}
}
</script>

<style scoped lang="scss">
	.conbox{
		width: 100%;
		height: 100%;
		display: block;
		background: #F5F5F5;
	}
	.assset_top{
		width: 100%;
		height: 268px;
		position: relative;
		background-image: url($imgUrl+'getguest/icon_assbg.png');
		background-size: cover;
	}
	.assset_top p{
		text-align: center;
		float: left;
		width: 100%;
		font-size: 24px;
		color: #3A1B04;
	}
	.assset_top p:first-child{
		font-size: 24px;
		margin-top: 48px;
		margin-bottom: 10px;
	}
	.assset_top p:nth-child(2){
		font-size:60px;
		font-weight: bold;
	}
	.assset_top p:nth-child(3){
		color:#A88809;
		margin-top: 12px;
	}
	.assset_money{
		width: 90%;
		height: 90px;
		left: 5%;
		top: 218px;
		position: absolute;
		border-radius: 10px;
		background: white;
	}
	.assset_money li{
		width: 50%;
		float: left;
		font-size: 30px;
		line-height: 90px;
		text-align: center;
	}
	.assset_money li:first-child{
		background: url($imgUrl+'getguest/icon_makemoney.png');
		background-repeat:no-repeat;
		background-size: 40px 40px;
		background-position: 26% 24px;
	}
	.assset_money li:nth-child(2){
		background: url($imgUrl+'getguest/icon_cash.png');
		background-repeat:no-repeat;
		background-size: 40px 40px;
		background-position: 26% 24px;
	}
	.list_content{
		width: 100%;
		height: auto;
		margin-top: 70px;
	}
	.list_content ul{
		width: 100%;
		height: auto;
		background: white;
	}
	.list_content ul li{
		width: 92%;
		margin-left: 4%;
		height: 100px;
		line-height: 100px;
		font-size: 28px;
		color: #666666;
		background: url($imgUrl+'login/right.png') right center;
		background-repeat:no-repeat;
		background-size: 15px 28px;
		border-bottom: 1px solid #eeeeee;
	}
	.list_content ul li:last-child{
		border-bottom: 0;
	}
	.list_content ul li span:first-child{
		float: left;
	}
	.list_content ul li span:nth-child(2){
		float: right;
		margin-right: 60px;
	}
	.lab_line{
		height: 20px;
		width: 100%;
		background: #eeeeee;
	}
</style>
